package cj.web.marry.dao;
/*
 *  
 *  
*/
import java.util.List;
import java.util.Map;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.SQL;

/**
 * 
 * @author 
 *
 */
@DAO
public interface VoteResultsDAO{
	
    @SQL("SELECT voteItemIds FROM VoteResults where deleteFlag=1 AND voteId=:1 AND requestIp=:2 ")
    List<Map> queryByIdAndIp(int voteId,String requestIp);
    
    @SQL("SELECT voteItemIds FROM VoteResults where deleteFlag=1 AND voteId=:1 AND voteItemIds=:2 AND requestIp=:3 ")
    List<Map> queryByIdAndIp(int voteId,String voteItemIds,String requestIp);
    
    @SQL("INSERT INTO VoteResults ("
			        		+ "voteId,"
			        		+ "voteItemIds,"
			        		+ "requestIp,"
			        		+ "deleteFlag,"
			        		+ "createUser,"
			        		+ "createAt"
							+") VALUES ("
							+ ":1,"
							+ ":2,"
							+ ":3,"
							+ "1,"
							+ ":3,"
							+ "now()"
					+")")
    void create(int voteId,String voteItemIds,String requestIp);
}